package cn.anecansaitin.firecrafting.common;

import net.minecraftforge.common.ForgeConfigSpec;

//配置文件
public class Config {
    public static final ForgeConfigSpec CONFIG;
    public static final ForgeConfigSpec.ConfigValue<Integer> WORLD_MAX_COUNT;
    public static final ForgeConfigSpec.ConfigValue<Integer> WORLD_MAX_TIME;
    public static final ForgeConfigSpec.ConfigValue<Integer> WORLD_MAX_FIRE_PROTECTION;
    public static final ForgeConfigSpec.BooleanValue ENABLE_INTERFACE;
    public static final ForgeConfigSpec.ConfigValue<Integer> PROCESSING_TIME;

    static {
        //配置文件构造器
        ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder();
        //Common块开始
        builder.push("Craft in world config");
        //添加max count属性
        WORLD_MAX_COUNT = builder.comment("Max item count every crafting").defineInRange("MaxCount", 18, 1, 18);
        //添加max time属性
        WORLD_MAX_TIME = builder.comment("Item information retention time(tick)").define("MaxTime", 200);
        //添加max fire protection属性
        WORLD_MAX_FIRE_PROTECTION = builder.comment("Protect product without fire in ticks").define("MaxFireProtection", 160);
        //Common块结束
        builder.pop();

        builder.push("Craft in machine");
        ENABLE_INTERFACE = builder.comment("Enable fire interface").define("EnableInterface", true);
        PROCESSING_TIME = builder.comment("Processing time(tick)").define("ProcessingTime", 20);
        builder.pop();
        //完成构建
        CONFIG = builder.build();
    }
}
